feat: added DisabledVault to disable id-cache when noFunctional is set#1072
Conversation
…when-no-functional-is-true
| }); | ||
| const cacheKey = `${mpInstance._Store.storageName}-id-cache`; | ||
| if (mpInstance._Store.getNoFunctional()) { | ||
| console.log('createIdentityCache: noFunctional is true'); |
There was a problem hiding this comment.
remove
| console.log('createIdentityCache: noFunctional is true'); |
| }); | ||
|
|
||
| describe('#createIdentityCache', function() { | ||
| it('should use LocalStorageVault when noFunctional is false by default', async () => { |
There was a problem hiding this comment.
you aren't really confirming that the vault is or isn't localstorage vs disablevault.
| }); | ||
|
|
||
| describe('#createIdentityCache', function() { | ||
| it('should use LocalStorageVault when noFunctional is false by default', async () => { |
There was a problem hiding this comment.
| it('should use LocalStorageVault when noFunctional is false by default', async () => { | |
| it('should save id cache to local storage when noFunctional is false by default', async () => { |
| expect(localStorage.getItem('mprtcl-v4_abcdef-id-cache')).to.be.ok; | ||
| }); | ||
|
|
||
| it('should use DisabledVault when noFunctional is true', async () => { |
There was a problem hiding this comment.
| it('should use DisabledVault when noFunctional is true', async () => { | |
| it('should NOT save id cache to local storage when noFunctional is true', async () => { |
| }); | ||
|
|
||
| it('should use DisabledVault when noFunctional is true', async () => { | ||
| mParticle.config.noFunctional = true; |
There was a problem hiding this comment.
| mParticle.config.noFunctional = true; | |
| mParticle.config.launcherOptions = {noFunctional: true}; |
There was a problem hiding this comment.
@rmi22186 Currently noFunctional / noTargeting is only read from top‑level mParticle.config during init, not from config.launcherOptions that is why mParticle.config.noTargeting = true; works. To use mParticle.config.launcherOptions = {noTargeting: true}; we need to update store to source privacy flags from config.launcherOptions.
There was a problem hiding this comment.
this will need to be updated once you sync this branch with development after the #1064 (review) is merged
| expect(localStorage.getItem('mprtcl-v4_abcdef-id-cache')).not.to.be.ok; | ||
| }); | ||
|
|
||
| it('should use LocalStorageVault when noFunctional is false', async () => { |
There was a problem hiding this comment.
| it('should use LocalStorageVault when noFunctional is false', async () => { | |
| it('should save id cache to local storage when noFunctional is false', async () => { |
| describe('#store', () => { | ||
| it('should NOT write to localStorage', () => { | ||
| const storageKey = 'test-disabled-store-empty'; | ||
| const vault = new DisabledVault<Dictionary<Dictionary<string>>>( |
There was a problem hiding this comment.
seems overly complicated to use the Dictionary<Dictionary<string>>> type and testObject. maybe just make things simpler and shorter by using testString here and throughout the tests below
| ); | ||
|
|
||
| vault.purge(); | ||
| console.log(window.localStorage.getItem(storageKey)); |
There was a problem hiding this comment.
| console.log(window.localStorage.getItem(storageKey)); |
…disable-identity-cache-when-no-functional-is-true
…disable-identity-cache-when-no-functional-is-true
|
# [2.47.0](v2.46.0...v2.47.0) (2025-10-01) ### Bug Fixes * SDKE-317 Call deferred methods on Rokt Manager instead of kit ([#1076](#1076)) ([3a0643b](3a0643b)) ### Features * added DisabledVault to disable id-cache when noFunctional is set ([#1072](#1072)) ([8187d72](8187d72)) * added noFunctional in batchUploader to disable offline storage ([#1063](#1063)) ([97dd88a](97dd88a)) * disable session cookie/localStorage when noFunctional is set ([#1070](#1070)) ([edb2e61](edb2e61)) * disable time tracking when noTargeting is set to true ([#1064](#1064)) ([71c891c](71c891c))
|
🎉 This PR is included in version 2.47.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |



Instructions
developmentSummary
Testing Plan
Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)